package com.qf.controller;

import com.qf.feign.TestFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/customer")
//动态刷新从配置中心拉取的内容
@RefreshScope
public class CustomerController {

    @Autowired
    private TestFeign testFeign;

    //从nacos配置中心当中读取
    @Value("${version}")
    private String version;

    @RequestMapping("/t1")
    public String t1() throws Exception {
        String str = testFeign.hello();
        Thread.sleep(200);
        return str + version;
    }
}
